package com.tomecode.tools.maven.settings.model;

import com.tomecode.tools.maven.settings.model.xml.XmlElement;

/**
 * 
 * The conditional logic which will automatically trigger the inclusion of this
 * profile.
 * 
 * @author Tomas Frastia
 * @see http://www.tomecode.com or
 *      http://code.google.com/p/maven-settings-editor/
 * 
 */
public final class Activation extends XmlElement {
	/**
	 * Flag specifying whether this profile is active as a default.
	 */
	private boolean activeByDefault = false;
	/**
	 * Specifies that this profile will be activated when a matching JDK is
	 * detected.
	 */
	private String jdk;
	/**
	 * Specifies that this profile will be activated when matching OS attributes
	 * are detected.
	 */
	private Os os;
	/**
	 * Specifies that this profile will be activated based on existence of a
	 * file.
	 */
	private File file;
	/**
	 * Specifies that this profile will be activated when this System property
	 * is specified.
	 */
	private Property property;

	public Activation() {
		file = new File();
		property = new Property();
		os = new Os();
	}

	/**
	 * Copy exits {@link Activation} to new {@link Activation}
	 * 
	 * @param activation
	 */
	public Activation(Activation activation) {
		file = new File(activation.getFile());
		property = new Property(activation.getProperty());
		os = new Os(activation.getOs());
		activeByDefault = activation.isActiveByDefault();
		jdk = activation.getJdk();
	}



	public final boolean isActiveByDefault() {
		return activeByDefault;
	}

	public final void setActiveByDefault(boolean activeByDefault) {
		this.activeByDefault = activeByDefault;
	}

	public final String getJdk() {
		return jdk;
	}

	public final void setJdk(String jdk) {
		this.jdk = jdk;
	}

	public final File getFile() {
		return file;
	}

	public final void setFile(File file) {
		this.file = file;
	}

	public final Os getOs() {
		return os;
	}

	public final void setOs(Os os) {
		this.os = os;
	}

	public final Property getProperty() {
		return property;
	}

	public final void setProperty(Property property) {
		this.property = property;
	}

}
